package com.chb.javabasic.Controller;

import com.chb.javabasic.interfaces.MathOperation;

import java.util.Arrays;
import java.util.List;

public class lambdaController {

    public static void main(String[] args) {
        // 函数式接口
        MathOperation op = (a, b) -> a + b;
        int result = op.op(5,3);
        System.out.println(result);

        // 遍历集合
        List<Integer> numbers = Arrays.asList(1,2,3,4,5);
        System.out.println(numbers);
        numbers.forEach(number -> System.out.println(number));
    }
}
